package com.lemons.hackaton.obj;

import java.util.ArrayList;
import java.util.List;

public class Journey {
	public static List<String> personDictionary = new ArrayList<String>(); 
	public static List<String> activityDictionary = new ArrayList<String>(); 
	
	private Integer duration;
	private List<Activity> activities;
	private List<Person> persons;

	public Integer getDuration() {
		return duration;
	}

	public static List<String> getPersonDictionary() {
		return personDictionary;
	}

	public static void setPersonDictionary(List<String> personDictionary) {
		Journey.personDictionary = personDictionary;
	}

	public static List<String> getActivityDictionary() {
		return activityDictionary;
	}

	public static void setActivityDictionary(List<String> activityDictionary) {
		Journey.activityDictionary = activityDictionary;
	}

	public void setDuration(Integer duration) {
		this.duration = duration;
	}

	public List<Activity> getActivities() {
		return activities;
	}

	public void setActivities(List<Activity> activities) {
		this.activities = activities;
	}

	public List<Person> getPersons() {
		return persons;
	}

	public void setPersons(List<Person> persons) {
		this.persons = persons;
	}

	public Journey(Integer duration) {
		super();
		this.duration = duration;
	}

	public Journey() {

	}
	
	public Person getPerson(String personName) {
		if(!persons.isEmpty()) {
			for( Person p : persons) {
				if (p.getName().equals(personName)) {
					return p;
				}
			}
		}
		return null;
	}
	
	@Override
	public String toString() {
		return "Journey [duration=" + duration + ", activities=" + activities
				+ ", persons=" + persons + "]";
	}

	
	
}
